package com.xinfan.io.buffered;

import java.io.*;

/**
 * @Author xin
 * @Date 2022/6/8 21:30
 * @Version 1.0
 *
 * 字节处理流拷贝文件
 */
public class BufferedInputStream_ {
    public static void main(String[] args) throws IOException {

        BufferedInputStream bis = null;

        BufferedOutputStream bos = null;



        String path = "G:\\桌面\\test.txt";
        String des = "G:\\桌面\\1111.txt";

        byte[] bytes = new byte[1024];
        int readLen = 0;
        

        bis = new BufferedInputStream(new FileInputStream(path));

        bos = new BufferedOutputStream(new FileOutputStream(des));

        while ((readLen = bis.read(bytes)) != -1) {
            bos.write(bytes,0,readLen);
        }

        bos.close();
        bis.close();

    }
}
